package dao.impl;

import java.sql.SQLException;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;

import dao.PermissionsDao;
import entity.User_Inf;
import util.C3P0Util;

public class PermissionsDaoImpl implements PermissionsDao {

	@Override
	public User_Inf Permissionusername(String username) {
		// 操作数据库对象
		QueryRunner qr = new QueryRunner(C3P0Util.getDataSource());
		//查询
		User_Inf User_Inf =null;
		String sql="SELECT * FROM `user_inf` WHERE username = ?";
		
		try {
			User_Inf = qr.query(sql, username,  new BeanHandler<User_Inf>(User_Inf.class));

		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return User_Inf;
	}

}
